<template>
	<view>
		<view class="my-header">
			<!-- 背景图 -->
			<view class="my-header_bg">
				<image :src="userinfo.avatar" mode="aspectFill"></image>
			</view>
			<!-- 头像 -->
			<view class="my-header_logo">
				<view class="my-header_logo-box">
					<image :src="userinfo.avatar" mode="aspectFill"></image>
				</view>
				<text class="my-header_name">{{userinfo.author_name}}</text>
			</view>
			<!-- 信息 -->
			<view class="my-header_info">
				<view class="my-header_info-box">
					<text class="my-header_info-title">发帖</text>
					<text class="my-header_name">{{userinfo.article_ids.length}}</text>
				</view>
				<view class="my-header_info-box">
					<text class="my-header_info-title">粉丝</text>
					<text class="my-header_name">{{userinfo.fans_count}}</text>
				</view>
				<view class="my-header_info-box">
					<text class="my-header_info-title">积分</text>
					<text class="my-header_name">{{userinfo.integral_count||0}}</text>
				</view>
			</view>

		</view>
		<!-- 其他部分 -->
		<view class="my-content">
			<view class="my-content_list" @click="openMyArticle">
				<view class="my-content_list-title">
					<uni-icons class="icons" type="contact" size="14" color="#666"></uni-icons>
					<text>我的文章</text>
				</view>
				<uni-icons type="arrowright"></uni-icons>
			</view>
			<view class="my-content_list" @click="openFeedback">
				<view class="my-content_list-title">
					<uni-icons class="icons" type="help" size="14" color="#666"></uni-icons>
					<text>意见反馈</text>
				</view>
				<uni-icons type="arrowright"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {

			}
		},
		onLoad(){
			// console.log(this.userinfo)
		},
		computed:{
			...mapState(['userinfo'])
		},
		methods: {
			openMyArticle(){
				uni.navigateTo({
					url:'/pages/my-article/my-article'
				})
			},
			openFeedback(){
				uni.navigateTo({
					url:'/pages/feedback/feedback'
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F5F5F5;
	}
	.my-header {
		padding-bottom: 15px;
		position: relative;
		.my-header_bg{
			position: absolute;
			top: 0;
			right: 0;
			left: 0;
			bottom: 0;
			opacity: 0.3;
			filter: blur(8px);
			image{
				width: 100%;
				height: 100%;
			}
		}
		.my-header_logo {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			padding-top: 30px;

			.my-header_logo-box {
				width: 60px;
				height: 60px;
				overflow: hidden;
				border-radius: 50%;

				image {
					height: 100%;
					width: 100%;
				}
			}

			.my-header_name {
				margin-top: 15px;
				font-size: 16px;
				font-weight: 700;
			}
		}

		.my-header_info {
			display: flex;
			margin-top: 15px;
			// margin-bottom: 30px;
			.my-header_info-box {
				display: flex;
				justify-content: center;
				align-items: center;
				flex-direction: column;
				width: 100%;
				font-size: 12px;
				color: #999;
			}

			.my-header_info-title {
				font-size: 14px;
				color: #333;
			}
		}
	}

	.my-content {
		.my-content_list {
			display: flex;
			justify-content: space-between;
			margin-bottom: 10px;
			padding: 15px;
			background-color: #fff;
			color: #333;
			font-size: 14px;
		}

		.my-content_list-title {
			display: flex;
			align-items: center;
		}

		.icons {
			margin-right: 5px;
		}
	}
</style>
